<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2023/10/25
  Time: 11:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>hello jsp</h1>

<%
    // 放到 _JSPService()方法中
    System.out.println("hello,jsp~");
    int a = 2;
    int c = a + 1;
    int i = 1 / 0;
%>
<%--输出到页面上--%>
<%="hello"%>

<%!
    // 放到 _JSPService()方法外面 放到类里面 可以声明方法  可以声明成员变量等等
    void test() {
        System.out.println("test 方法被调用");
    }

    String name = "hello";
%>


<%
    test();
    System.out.println(name);
%>



</body>
</html>
